package jmine.tec.test.metric.performance;

import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

/**
 * Representa a tag de 'report' dentro do xml de performance. Deve possuir atributos e um conjunto de test's.
 * 
 * @author bruno.ortiz
 */
@XStreamAlias("report")
public class Report implements IReport {

    @SuppressWarnings("unused")
    @XStreamAlias("name")
    @XStreamAsAttribute
    private String reportName;

    @SuppressWarnings("unused")
    @XStreamAlias("categ")
    @XStreamAsAttribute
    private String categoryName;

    @SuppressWarnings("unused")
    @XStreamImplicit
    private List<Tests> tests;

    /**
     * Construtor da classe Report
     * 
     * @param reportName Representa o nome da tag Report no xml de performance.
     * @param categoryName Representa o nome da categoria na tag report no xml de performance
     * @param tests Representa a lista de tests da tag Report no xml de performance
     */
    public Report(String reportName, String categoryName, List<Tests> tests) {
        if (tests == null) {
            throw new IllegalStateException();
        }
        this.reportName = reportName;
        this.categoryName = categoryName;
        this.tests = tests;
    }

    /**
     * @param reportName the reportName to set
     */
    public void setReportName(String reportName) {
        this.reportName = reportName;
    }

    /**
     * @param categoryName the categoryName to set
     */
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

}
